package com.sw.ss.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.sw.ss.model.User;
import com.sw.ss.service.IUserService;
import com.sw.ss.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController {
	    @Autowired
		private IUserService userService;
		
		@RequestMapping(value="{id}/show",method=RequestMethod.GET)
		public String  test(@PathVariable int id,Model model){
			
			User user = userService.load(5);
			model.addAttribute("user",user);
			return "user/show";
		}
}
